package smurf.view;

import java.util.Locale;
import java.util.ResourceBundle;
import javax.swing.JPanel;
import org.icepdf.ri.common.SwingController;
import org.icepdf.ri.common.SwingViewBuilder;
import org.icepdf.ri.util.PropertiesManager;

/**
 * PDFViewer is used to view PDF files from within the Rubis application
 * 
 * @author Bishan Kumar Madhoo <bishan.madhoo@idsoft.mu>
 * @version 0.1
 */
public class PDFViewer extends javax.swing.JFrame {

    private JPanel viewerPanel;
    private PropertiesManager viewerProperties;
    private SwingViewBuilder factory;
    public SwingController pdfViewerController;

    /**
     * Creates new form PDFViewer
     */
    public PDFViewer() {
        
        initComponents();

        // Controller instance
        this.pdfViewerController = new SwingController(
                ResourceBundle.getBundle("org.icepdf.ri.resources.MessageBundle", Locale.FRENCH));

        // Build a SwingViewFactory configured with the controller
        this.factory = new SwingViewBuilder(this.pdfViewerController);

        // PDF viewer panel
        this.viewerPanel = this.factory.buildViewerPanel();

        // Add the viewer panel to the frame
        this.getContentPane().add(this.viewerPanel, java.awt.BorderLayout.CENTER);
    }

    /**
     * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The
     * content of this method is always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setMinimumSize(new java.awt.Dimension(800, 600));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
}
